package com.amkor.study.direct.dao;

import java.util.List;
import java.util.Map;

import org.apache.commons.fileupload.FileItem;
import org.springframework.jdbc.core.BeanPropertyRowMapper;

import com.amkor.study.direct.domain.Personal;
import com.amkor.web.common.dao.AbstractSimpleJdbcDaoSupport;

public class DirectDaoJdbc extends AbstractSimpleJdbcDaoSupport implements DirectDao {


	
	@SuppressWarnings("deprecation")
	public List<Personal> getPersonalAll() throws Exception {
		return simpleJdbcTemplate.query(
				" select id, firstName, lastName, company, email, dob, age, coworker from sencha.personal ", 
				new BeanPropertyRowMapper<Personal>(Personal.class)
		);
	}

	@SuppressWarnings("deprecation")
	public void createPersonal(Map<String, String> formFields, Map<String, FileItem> fileFields) throws Exception {
		System.out.println(formFields);
		System.out.println(7890);
		simpleJdbcTemplate.update("insert into sencha.personal(firstName, lastName, company, email, dob, age, coworker) values("+formFields.get(key)+")");
		return;
    }









	

	

}